

class Pomelo  extends PomeloForEgret.Pomelo{
     private constructor(){
        super();
    }

  private static _inst:Pomelo;

    static ins(){
        if(this._inst==null){
            this._inst=new Pomelo();
            Pomelo.DEBUG=false;
        }
        return Pomelo._inst;
    }

    public init(obj){
          return new Promise((s,e)=>{
               super.init(obj, (res)=>{
                   if(res.code!==NetResultCode.SUCCESS){
                       e(res)
                   }
                   else{
                       s(res)
                   }
               })
        });
    }

    public request(route,msg={}){
        return new Promise((s,e)=>{
               super.request(route, msg, (res)=>{
                   if(res.code!==NetResultCode.SUCCESS){
                       e(res)
                   }
                   else{
                       s(res)
                   }
               })
        });
      
    }
 

}